# Author:: Alexandre Ribeiro de Souza (<alexandre@lumis.com.br>)

::Chef::Recipe.send(:include, Opscode::Aws::Ec2)

if node.attribute?('ec2')
  aws = data_bag_item("aws", "knife-user")
  
  lumis_aws_ec2_tags "ec2_name_tag" do
    aws_access_key aws['aws_access_key_id']
    aws_secret_access_key aws['aws_secret_access_key']
    tag "Name"
    value Chef::Config[:node_name]
    action :create
  end
end
